package part18;

import java.io.*;

/**
 * @author wcj
 * @Date 2021/6/3 18:48
 * @Version 1.0
 */
public class Part1818 {

    /**
     * IO的重定向：System.setIn();System.setOut();System.setErr()
     *
     * @param args
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        PrintStream console = System.out;
        BufferedInputStream in = new BufferedInputStream(new FileInputStream("./src/part18/Part1818.java"));
        PrintStream out = new PrintStream(new BufferedOutputStream(new FileOutputStream("test.out")));
        System.setIn(in);
        System.setOut(out);
        System.setErr(out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s;
        while ((s = br.readLine()) != null) {
            System.out.println(s);
        }
        out.close();
        System.setOut(console);
    }
}
